package com.qf.demo.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qf.demo.entity.Product;
import com.qf.demo.entity.bcata;
import com.qf.demo.service.goodsService;
import com.qf.demo.vo.goodDetail;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.context.annotation.RequestScope;

import java.util.List;

@Controller
@RequestMapping("/goods")
public class GoodsController {

    @Autowired
    private goodsService gs;

    @RequestMapping("/all")
    @ResponseBody
    public List<Product> test0(@RequestBody bcata bb){
        System.out.println(bb);
        List<Product> lists=gs.getList(bb);
        System.out.println(lists);
        return lists;
    }


    @RequestMapping("/detail")
    @ResponseBody
    public goodDetail test1(String ids){
        Integer id=Integer.valueOf(ids);
        goodDetail ggg=gs.getDetail(id);
        return ggg;
    }



}
